package ute.mvc.dao;

import org.hibernate.SessionFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import ute.mvc.model.TestAndQuizz_Student;

@Repository("testAndQuizz_StudentDAO")
public class TestAndQuizz_StudentDAOImp implements TestAndQuizz_StudentDAO{
	@Autowired
	SessionFactory sessionFactory;
	
	public void addTestAndQuizz_Student(
			TestAndQuizz_Student testAndQuizz_Student) {
		sessionFactory.getCurrentSession().save(testAndQuizz_Student);
	}

	public void updateTestAndQuizz_Student(
			TestAndQuizz_Student testAndQuizz_Student) {
		sessionFactory.getCurrentSession().merge(testAndQuizz_Student);
	}

	public void deleteTestAndQuizz_Student(
			TestAndQuizz_Student testAndQuizz_Student) {
		sessionFactory.getCurrentSession().delete(testAndQuizz_Student);
	}

	public TestAndQuizz_Student getTestAndQuizz_Student(String id) {
		// TODO Auto-generated method stub
		return (TestAndQuizz_Student) sessionFactory.getCurrentSession().get(TestAndQuizz_Student.class, id);
	}
}
